<?php
header('Access-Control-Allow-Origin:*');
// 响应类型
header('Access-Control-Allow-Methods:GET,DELETE,HEAD,POST,PUT,PATCH,OPTIONS');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,content-type,token,id,Authorization');
header("Access-Control-Request-Headers: Origin, X-Requested-With, content-Type, Accept, Authorization");

Route::group(['middleware' => 'web', 'domain' => env('WE_CHAT_HOST',''), 'namespace' => 'Modules\WeChat\Http\Controllers'], function()
{

    Route::get('wechat-welcome', ['as' => 'wechat_welcome', 'uses' => 'WeChatController@welcome']);//欢迎页面

    Route::get('/', 'WeChatController@index')->name('register');
    //門店入駐

    //富文本编辑器上传图片
    Route::post('uploaded-file-wangEditor', ['as' => 'uploaded_file_wangEditor', 'uses' => 'GoodsController@uploaded_file_wangEditor']);

    /*通用限制仅上传图片接口*/
    Route::post('uploaded-file-onlyimg', ['as' => 'uploaded_file_onlyimg', 'uses' => 'CommonController@uploaded_file_onlyimg']);



    Route::get('wechat_index', ['as' => 'wechat_index', 'uses' => 'WeChatController@index']);//公众号获取openid
    Route::post('wechat_account_binding', ['as' => 'wechat_account_binding', 'uses' => 'WeChatController@account_binding']);//绑定

    Route::group(['middleware' => ['wx_is_login']], function () {

        Route::get('wechat_me', ['as' => 'wechat_me', 'uses' => 'WeChatController@me']);//连接信息

        /*用户*/
        Route::post('wechat_account_unbinding', ['as' => 'wechat_account_unbinding', 'uses' => 'WeChatController@account_unbinding']);//解绑
        Route::get('wechat_admin_user_info', ['as' => 'wechat_admin_user_info', 'uses' => 'AdminUserController@user_info']);//用户信息

        /*订单*/
        Route::get('wechat_order_checkpoint', ['as' => 'wechat_order_checkpoint', 'uses' => 'OrderController@order_checkpoint_list']);//年检预约订单-已完成
        Route::get('wechat_deal_order_checkpoint', ['as' => 'wechat_deal_order_checkpoint', 'uses' => 'OrderController@deal_order_checkpoint_list']);//年检预约订单-待处理

        Route::put('wechat_order_checkpoint_complete_all', ['as' => 'wechat_order_checkpoint_complete_all', 'uses' => 'OrderController@order_checkpoint_complete_all']);//年检预约订单 - 检测完成（全部车）
        Route::put('wechat_order_checkpoint_complete_single', ['as' => 'wechat_order_checkpoint_complete_single', 'uses' => 'OrderController@order_checkpoint_complete_single']);//年检预约订单 - 检测完成（单辆车）
        Route::put('wechat_order_checkpoint_fail_single', ['as' => 'wechat_order_checkpoint_fail_single', 'uses' => 'OrderController@order_checkpoint_fail_single']);//年检预约订单 - 检测失败(单辆车-退款)


        /*yang xiao dong*/
        Route::post('shop-settled-in', ['as' => 'shop_settled_in', 'uses' => 'ShopController@settledIn']);
        Route::get('shop-get-detail', ['as' => 'shop_get_detail', 'uses' => 'ShopController@getShopDetail']);//获取门店信息
        Route::post('shop-statistics', ['as' => 'shop_statistics', 'uses' => 'ShopController@statistics']);//获取门店数据统计
        Route::get('shop-get-order', ['as' => 'shop_get_order', 'uses' => 'ShopController@getShopOrder']);//获取维修店的订单记录（积分订单，服务订单，现金订单）

        Route::get('get-goods-list', ['as' => 'get_goods_list', 'uses' => 'GoodsController@goodsList']);//获取门店商品服务列表
        Route::get('goods-delete', ['as' => 'goods_delete', 'uses' => 'GoodsController@delete']);//删除门店服务商品
        Route::get('goods-change-status', ['as' => 'goods_change_status', 'uses' => 'GoodsController@changeStatus']); //门店商品上下架
        Route::post('goods-create', ['as' => 'goods_create', 'uses' => 'GoodsController@create']);//添加门店服务商品
        Route::get('goods-get-detail', ['as' => 'goods_get_detail', 'uses' => 'GoodsController@getDetail']); //获取门店服务商品详情
        Route::post('goods-update', ['as' => 'goods_update', 'uses' => 'GoodsController@update']);//编辑门店服务商品
        Route::get('goods-get-type', ['as' => 'goods_get_type', 'uses' => 'GoodsController@getType']);//获取服务商品分类

        //订单列表（积分商品）
        Route::get('get-goods-order-list', ['as' => 'get_goods_order_list', 'uses' => 'GoodsOrderController@getGoodsOrderList']);//订单列表
        Route::get('get-goods-order-detail', ['as' => 'get_goods_order_detail', 'uses' => 'GoodsOrderController@getGoodsOrderDetail']);//订单详情

        //订单列表（服务商品）
        Route::get('get-repair-order-list', ['as' => 'get_repair_order_list', 'uses' => 'GoodsOrderController@getRepairOrderDist']);//服务订单列表
        Route::get('get-repair-order-detail', ['as' => 'get_repair_order_detail', 'uses' => 'GoodsOrderController@getRepairOrderDetail']);//服务订单详情
    });





});

